package com.sky.mapper;

import com.sky.entity.OrderDetail;
import com.sky.vo.SalesTop10ReportVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface OrderDetailMapper {
    void insertBatch(List<OrderDetail> orderDetails);

    /*
    * 根据订单id查询订单明细
    * */
    @Select("select * from sky_take_out.order_detail where order_id = #{orderId}")
    List<OrderDetail> getByOrderId(Long orderId);

    /*
    * 获取指定时间段的前十销量菜品
    * */
    List<SalesTop10ReportVO> getSalesTop10(LocalDateTime begin, LocalDateTime end);
}
